Skip to content

Refactor date-timezone conversion to fix DB incompatibilities with Log utility#30

Open
chasegiunta wants to merge 1 commit intodoublesecretagency:v2-devfrom
chasegiunta:patch-1
Open

Refactor date-timezone conversion to fix DB incompatibilities with Log utility#30
chasegiunta wants to merge 1 commit intodoublesecretagency:v2-devfrom
chasegiunta:patch-1

Conversation

@chasegiunta
Copy link
Copy Markdown

While evaluating this plugin, notification logs weren't showing up for me at all locally. Narrowed it down to the CONVERT_TZ SQL function being the culprit (maybe an incompatibility with MariaDB / MySQL versions?). After a lengthy discussion with our robotic AI overlords, I was able to accomplish the same timezone conversion using PHP and was able to see my logs!

AI generated summary below:


This pull request updates the way log records are filtered by date in the NotificationLog utility. Instead of relying on SQL timezone conversion, it now uses PHP's DateTime and DateTimeZone classes to compute the start and end of the selected day in the system timezone, ensuring more accurate and reliable date filtering.

Improvements to date filtering and timezone handling:

  • Added import for DateTimeZone and updated logic to use PHP's DateTime and DateTimeZone for determining the start and end of the selected day in the system timezone (src/utilities/NotificationLog.php).
  • Modified the log retrieval query to use a BETWEEN condition on dateCreated using the computed start and end of day, replacing the previous SQL CONVERT_TZ approach (src/utilities/NotificationLog.php).

@chasegiunta chasegiunta changed the title Refactor date handling in NotificationLog.php Refactor date-timezone conversion to fix DB incompatibilities with Log utility Aug 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant